home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
program
/
n_b_v203.zip
/
X_DIRS.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
3KB
|
56 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME X_DIRS .DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
$INCLUDE "DAS-NB01.INC"
$INCLUDE "DAS-NB02.INC"
COLOR 7,0
CLS
? "┌────────────────────────────────────────────────────────────────────────
? "│ fDIR$ ( Mask$, Attributes?, Fields? )
? "│ fDIRlist%( F$(), Mask$, Attributes?, Fields?, Sorted% )
? "├────────────────────────────────────────────────────────────────────────
? "│ Let's start with fDIR$ as it explains most of fDIRlist% anyhow!
? "│ It is almost like PowerBASIC's DIR$ but it provides 2 extra services:
? "│ 1) it will skip any file or directory that does not match Attributes?
? "│ 2) it returns a formatted file listing where Fields? is a bit-mapped
? "│ request voucher! Bits 0 thru 4 activate different fields.
? "│ fDIRlist% uses fDIR$ to fill the array. Although it will not go past
? "│ UBOUND( F$(1) ) it will continue to find matches and return the actual
? "│ count even if it is greater than UBOUND( F$() ). This lets the program
? "│ know if it needs to allocate more array elements and call the function
? "│ again.
? "└────────────────────────────────────────────────────────────────────────
Fields? = 0
DO
PRINT USING "Fields? = ## "; Fields?;
PRINT fDIR$( "*.*", 32, Fields? ); "<<<<<<"
SHIFT LEFT Fields?, 1
INCR Fields?, 1
LOOP UNTIL Fields? > &b00011111
LOCATE 25, 69 : PRINT "THUMP A KEY"; : fAnyKey : CLS
DIM F$(10)
Fields? = 1 ' EVERYTHING!
Last% = fDIRlist%( F$(), "*.*", 48, Fields?, -1 )
FOR X% = 1 TO MIN( Last%, 10 ) ' notice the MIN not MAX
PRINT F$(X%)
NEXT